package work.xiaohong.jijin.util;

import java.util.Random;

/**
 * 请求地址生成工具类
 */
public class JijinUrlUtil {

    public static String creatUrl(String code, int number){

        //产生一个七位数的随机数
        String lastNum = "";
        int num;
        Random ran = new Random ();
        for(int i = 0; i< number;i++){
            num = ran.nextInt(10);
            lastNum += num;
        }

        String url = "http://fundgz.1234567.com.cn/js/"+code+".js?rt="+lastNum;

//        System.out.println(url);

        return url;
    }


    public static void main(String[] args) {
        String s = creatUrl("00001", 8);
        System.out.println(s);
    }


}
